<?php
namespace app\common\model\ads;

use think\Model;

class Ads extends Model
{
    public static function getAds($sign){
        $ids=AdsLocation::getIdsBySign($sign);
        $res=self::whereIn("id",$ids)->field("id,ad_name,ad_image,ad_location")->order("ad_sort desc,id asc")->select();
        return $res;
    }

    public static function  addClick($id){
        $res=self::where("id",$id)->setInc("ad_click",1);
        if($res) return true;
        return  false;
    }
}